<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>在线考试系统后台教师管理页面</title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
    <link rel="stylesheet" href="assets/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
    <link rel="stylesheet" href="assets/css/ready.css" th:href="@{/assets/css/ready.css}">
    <link rel="stylesheet" href="assets/css/demo.css" th:href="@{/assets/css/demo.css}">
</head>
<body>
<div class="wrapper">
    <!--header-->
    <div th:replace="commons/bar::header"></div>

    <!--slidebar-->
    <div th:replace="commons/bar::#sidebar(activeUri='/teacher/getAllTeacher')"></div>

    <!--main panel-->
    <div class="main-panel">
        <div class="content">
            <div class="container-fluid">
                <h4 class="page-title">教师管理页面</h4>
                <div class="col-md-6">
                    <form th:action="@{/teacher/addTeacher}" method="post">
                        <input type="hidden" name="_method" value="put" th:if="${teacher!=null}">
                        <input type="hidden" name="teacherId" th:if="${teacher!=null}" th:value="${teacher.teacherId}">
                    <div class="card">
                        <div class="card-body">
                            <!--区分添加还是修改teacher==null？-->
                            <div class="form-group">
                                <label for="name">姓名</label>
                                <input type="text" class="form-control" id="name" name="teacherName" th:value="${(teacher!=null)}?${(teacher.teacherName)}" placeholder="shuzhao">
                            </div>
                            <div class="form-group">
                                <label for="name">账号</label>
                                <input type="text" class="form-control" id="account" name="teacherAccount" th:value="${(teacher!=null)}?${teacher.teacherAccount}" placeholder="shuzhao11 or 2020001">
                            </div>
                            <div class="form-group">
                                <label for="email">邮箱</label>
                                <input type="email" class="form-control" id="email" name="teacherEmail" th:value="${(teacher!=null)}?${teacher.teacherEmail}" placeholder="Enter Email">
                                <small id="emailHelp" class="form-text text-muted">你的邮箱，我不会泄露</small>
                            </div>
                            <div class="form-group">
                                <label for="password">密码</label>
                                <input type="password" class="form-control" id="password" name="teacherPwd" th:value="${(teacher!=null)}?${teacher.getTeacherPwd()}" placeholder="Password">
                            </div>
                            <button class="btn btn-primary btn-border btn-round showpwd">显示密码</button>
                        </div>
                    </div>
                        <div class="card-action">
                            <button class="btn btn-success" th:text="${(teacher!=null)}?'修改':'添加'"></button>
                            <button class="btn btn-danger">取消</button>
                        </div>
                    </form>
                    </div>
                    </div>
                    </div>
                </div>
            </div>

    <!--footer-->
    <div th:replace="commons/bar::footer"></div>
<script src="assets/js/core/jquery.3.2.1.min.js" th:src="@{/webjars/jquery/3.2.1/jquery.js}"></script>
//显示密码
<script>
    $(".showpwd").click(function () {
        $("#password").attr("type","text");
        return false;
    })
</script>


</body>
</html>